package com.example.demolearn.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@ControllerAdvice
public class TestExceptionHandler {

    @ExceptionHandler
    public Object errorHandler(HttpServletRequest request,
                               HttpServletResponse response, Exception e) {
        e.printStackTrace();
        System.out.println("aaa");
        return "error";
    }
}
